import { useState } from 'react'
import { useAuth, useUser } from '@clerk/nextjs'

export default function useIsLogged() {
  const { isSignedIn } = useAuth()

  return isSignedIn
}

export function useToken() {
  const { getToken } = useAuth()

  const [token, changeToken] = useState<string | null>()

  getToken().then((tok: string | null) => {
    changeToken(tok)
  })

  return token
}
